﻿using PMS.Core.Configuration.CommonEnumConfigs;
using PMS.Data.Entities.Customers;
using PMS.Web.Models.Customers;
using PMS.Web.Models.Messages;

namespace PMS.Web.Factories.Customers
{
    /// <summary>
    /// Represents the interface of the customer model factory
    /// </summary>

    public interface ICustomerModelFactory
    {
        /// <summary>
        /// Prepare the login model
        /// 根据登录方式不同初始化不同登录方式所需要数据，可多种方式组合登录
        /// 但多种方式登录需要设置默认登录方式
        /// </summary>
        /// <param name="returnUrl">returnUrl for auto Url redirect after customer login success</param>
        /// <param name="loginType"></param>
        /// <returns>Login model</returns>
        LoginModel PrepareLoginModel(string returnUrl, LoginType loginType = LoginType.Password);

        /// <summary>
        /// Prepare the customer register model
        /// </summary>
        /// <param name="model">Customer register model</param>
        /// <returns>Customer register model</returns>
        RegisterModel PrepareRegisterModel(RegisterModel model);

        /// <summary>
        /// Prepare the change password model
        /// </summary>
        /// <param name="customerId">CustomerIdentifier</param>
        /// <returns>Change password model</returns>
        ChangePasswordModel PrepareChangePasswordModel(int customerId);

        /// <summary>
        /// Prepare the password recovery model
        /// </summary>
        /// <param name="model">Password recovery model</param>
        /// <returns>Password recovery model</returns>
        PasswordRecoveryModel PreparePasswordRecoveryModel();

        /// <summary>
        /// Prepare the password recovery confirm model
        /// </summary>
        /// <returns>Password recovery confirm model</returns>
        PasswordRecoveryConfirmModel PreparePasswordRecoveryConfirmModel(int customerId, string PasswordRecoveryToken);

        /// <summary>
        /// Prepare customer search model
        /// </summary>
        /// <param name="searchModel">Customer search model</param>
        /// <returns>Customer search model</returns>
        CustomerSearchModel PrepareCustomerSearchModel(CustomerSearchModel searchModel, RoleType roleType = RoleType.Guests);

        /// <summary>
        /// Prepare customer model
        /// </summary>
        /// <param name="model">Customer model</param>
        /// <param name="customer">Customer</param>
        /// <param name="excludeProperties">Whether to exclude populating of some properties of model</param>
        /// <returns>Customer model</returns>
        CustomerModel PrepareCustomerModel(CustomerModel model, Customer customer, bool excludeProperties = false);

        /// <summary>
        /// Prepare SearchModel For Customer-related-Emails
        /// </summary>
        /// <param name="customer"></param>
        /// <returns>CustomerEmailSearchModel</returns>
        CustomerEmailSearchModel PrepareCustomerEmailSearchModel(Customer customer);
        /// <summary>
        /// Prepare paged customer list model
        /// </summary>
        /// <param name="searchModel">Customer search model</param>
        /// <param name="hideSensitiveInfo">hide SensitiveInfo like Mobile/Email to prevent Data stolen</param>
        /// <returns>Customer list model</returns>
        CustomerListModel PrepareCustomerListModel(CustomerSearchModel searchModel, bool hideSensitiveInfo = true);

        /// <summary>
        /// Prepare online customer search model
        /// </summary>
        /// <param name="searchModel">Online customer search model</param>
        /// <returns>Online customer search model</returns>
        OnlineCustomerSearchModel PrepareOnlineCustomerSearchModel(OnlineCustomerSearchModel searchModel);

        /// <summary>
        /// Prepare paged online customer list model
        /// </summary>
        /// <param name="searchModel">Online customer search model</param>
        /// <returns>Online customer list model</returns>
        OnlineCustomerListModel PrepareOnlineCustomerListModel(OnlineCustomerSearchModel searchModel);

    }
}
